package framework.utils;

import org.springframework.util.StringUtils;

import java.nio.charset.StandardCharsets;

/**
 * 系统编码
 */
public class CharsetUtil {

    /**
     * 获取系统编码
     *
     * @return
     */
    public static String getSystemCharset() {
        String property = System.getProperty("file.encoding");
        if (StringUtils.hasLength(property)) {
            property = StandardCharsets.UTF_8.displayName();
        }
        return property;
    }

}
